package com.xh.customview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.AppCompatSeekBar;
import android.widget.SeekBar;

import com.xh.customview.utils.Log;
import com.xh.customview.views.RoundImagesPickView;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";

    AppCompatSeekBar mSeekBar;
    RoundImagesPickView mImagesPickView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "onCreate: begin");
        setContentView(R.layout.activity_main);
        Log.d(TAG, "onCreate: end");

        mImagesPickView = findViewById(R.id.images_pick);
        mSeekBar = findViewById(R.id.seek_bar);
        mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                Log.d(TAG, "onProgressChanged: progress=" + progress + ", fromUser=" + fromUser);
                mImagesPickView.setRotateAngle(180 * progress / 100);
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d(TAG, "onStart: ");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d(TAG, "onResume: ");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d(TAG, "onPause: ");
    }
}
